/*
 * claplan_oar.h
 *
 *  Created on: 2 Nov 2013
 *      Author: Tom Vercauteren
 */

#ifndef CLAPLAN_OAR_H_
#define CLAPLAN_OAR_H_

#include <string>
#include <ostream>

struct ClaplanOarMask
{
	unsigned char anastruct :1;
	unsigned char ntcp_model :1;
	unsigned char ntcp_name :1;
	unsigned char impf :1;
	unsigned char cmi :1;
	/** unused but set for memory alignement (padding) */
	unsigned char :3;
};

class ClaplanOar
{
private:
	/** Mask to determine which parameters have been set and which haven't.*/
	ClaplanOarMask mask;

	/** anastruct name */
	std::string anastruct;
	/** ntcp model */
	std::string ntcp_model;
	/** ntcp namel */
	std::string ntcp_name;
	/** importance factor */
	double impf;
	double cmi[2];
public:
	ClaplanOar();
	virtual ~ClaplanOar();

	friend std::ostream & operator<<(std::ostream & os, const ClaplanOar &oar);

	const std::string& getAnastruct() const;
	void setAnastruct(const std::string& anastruct);
	void unsetAnastruct();
	unsigned char isAnastructSet() const;

	const double* getCmi() const;
	void setCmi(const double *cmi);
	void unsetCmi();
	unsigned char isCmiSet() const;

	double getImpf() const;
	void setImpf(double impf);
	void unsetImpf();
	unsigned char isImpfSet() const;

	const std::string& getNtcpModel() const;
	void setNtcpModel(const std::string& ntcpModel);
	void unsetNtcpModel();
	unsigned char isNtcpModelSet() const;

	const std::string& getNtcpName() const;
	void setNtcpName(const std::string& ntcpName);
	void unsetNtcpName();
	unsigned char isNtcpNameSet() const;
};

#endif /* CLAPLAN_OAR_H_ */
